<template>
  <div>
    <h3 class="attach-title">项目信息</h3>
    <hr />
    <table class="table table-sm table-borderless table-attach-detail">
      <colgroup>
        <col width="20%" />
        <col width="30%" />
        <col width="20%" />
        <col width="30%" />
      </colgroup>
      <tbody>
        <tr>
          <td>{{ customerNameLabel }}：</td>
          <td>{{ projectData.customer_name }}</td>
          <td>被担保人类型：</td>
          <td>{{ projectData.org_class_name }}</td>
        </tr>
        <tr>
          <td>三证合一：</td>
          <td>{{ enumDispute[projectData.is_cert_merge] }}</td>
          <td>{{ isCompany ? '统一社会信用代码：' : '身份证号：' }}</td>
          <td>{{ isCompany ? projectData.register_no : projectData.lender_idcard }}</td>
        </tr>
        <tr>
          <td>担保(放款)金额：</td>
          <td>{{ projectData.warranty_amount }} 万元</td>
          <td>放款银行名称：</td>
          <td>{{ projectData.claim_bank_name }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
import { enumDispute } from '@/bank/plugins/enum'
import { projectIsCompany } from '@/bank/views/limit/index'

export default {
  components: {},
  props: {
    projectData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      enumDispute,
    }
  },
  computed: {
    isCompany() {
      return projectIsCompany(this.projectData)
    },
    customerNameLabel() {
      return this.isCompany ? '受保企业名称' : '贷款人姓名'
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>

<style lang="scss" scoped>
.attach-title {
  font-size: 1.1rem;
  font-weight: bold;
}
.table-attach-detail tr > td:nth-child(2n + 1) {
  text-align: right;
}
</style>
